package com.tcm.pay.enums;

/**
 * @author
 * 社交登录类型
 */
public enum LoginTypeEnum {
	/**
	 * 账号密码登录
	 */
	PWD("PWD", "账号密码登录"),

	/**
	 * 验证码登录
	 */
	SMS("SMS", "验证码登录"),

	/**
	 * QQ登录
	 */
	QQ("QQ", "QQ登录"),

	/**
	 * 微信登录
	 */
	WECHAT_OPEN("WECHAT_OPEN", "微信开放平台登录"),

	/**
	 * 微信公众号登录
	 */
	WECHAT_MP("WECHAT_MP", "微信公众号登录"),

	/**
	 * 微信小程序登录
	 */
	WECHAT_MINI("WECHAT_MINI", "微信小程序登录"),


	/**
	 * 码云登录
	 */
	GITEE("GITEE", "码云登录"),

	/**
	 * 开源中国登录
	 */
	OSC("OSC", "开源中国登录");

	/**
	 * 类型
	 */
	private final String type;
	/**
	 * 描述
	 */
	private final String description;

    LoginTypeEnum(String type, String description) {
        this.type = type;
        this.description = description;
    }

    public String type() {
        return this.type;
    }

    public String description() {
        return this.description;
    }

	public static String getValue(String value) {
		LoginTypeEnum[] businessModeEnums = values();
		for (LoginTypeEnum businessModeEnum : businessModeEnums) {
			if (businessModeEnum.type().equals(value)) {
				return businessModeEnum.type();
			}
		}
		return null;
	}

	public static String getDesc(String value) {
		LoginTypeEnum[] businessModeEnums = values();
		for (LoginTypeEnum businessModeEnum : businessModeEnums) {
			if (businessModeEnum.type().equals(value)) {
				return businessModeEnum.description();
			}
		}
		return null;
	}

}
